#ifndef _UTILSCONVOLVE_H_
#define _UTILSCONVOLVE_H_

#include <cv.h>

struct vuRect {
    int x;
    int y;
    int width;
    int height;

    vuRect(){}

    vuRect(int _x, int _y, int _width, int _height)
    {
        x = _x;
        y = _y;
        width = _width;
        height = _height;
    }
};

// convolves the src with the 2D kernel and puts result in dst
// it will only convolve the window
// NOTE:
//      - no in place convolution
//      - inefficient implemented
void vuConvolve(
    IplImage * src,
    IplImage * dst,
    vuRect window,
    float * kernel,
    int kernelWidth,
    int kernelHeight
    );

// convolves the src with the 2D kernel and puts result in dst
// NOTE:
//      - no in place convolution
//      - inefficient implemented
void vuConvolve(
    IplImage * src,
    IplImage * dst,
    float * kernel,
    int kernelWidth,
    int kernelHeight
    );

// convolves the src with the 1D horizontal kernel and puts result in dst
// it will only convolve the window
// NOTE:
//      - no in place convolution
//      - inefficient implemented
void vuConvolveHorizontal(
    IplImage * src,
    IplImage * dst,
    vuRect window,
    float * kernel,
    int kernelLength
    );

// convolves the src with the 1D vertical kernel and puts result in dst
// it will only convolve the window
// NOTE:
//      - no in place convolution
//      - inefficient implemented
void vuConvolveVertical(
    IplImage * src,
    IplImage * dst,
    vuRect window,
    float * kernel,
    int kernelLength
    );

#endif // _UTILSCONVOLVE_H_
